package com.zpark.entity.patients;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 患者病历记录表
 * @TableName medical_records
 */
@TableName(value ="medical_records")
@Data
public class MedicalRecords implements Serializable {
    /**
     * 病历ID(如MR20230001)
     */
    @TableId(value = "record_id")
    private String recordId;

    /**
     * 患者ID
     */
    @TableField(value = "patient_id")
    private String patientId;

    /**
     * 患者姓名
     */
    @TableField(value = "patient_name")
    private String patientName;

    /**
     * 就诊日期时间
     */
    @TableField(value = "visit_date")
    private Date visitDate;

    /**
     * 就诊科室
     */
    @TableField(value = "department")
    private String department;

    /**
     * 主治医生
     */
    @TableField(value = "doctor")
    private String doctor;

    /**
     * 病历状态(已归档/待完善/草稿)
     */
    @TableField(value = "status")
    private String status;

    /**
     * 主诉
     */
    @TableField(value = "chief_complaint")
    private String chiefComplaint;

    /**
     * 现病史
     */
    @TableField(value = "present_illness")
    private String presentIllness;

    /**
     * 既往史
     */
    @TableField(value = "past_history")
    private String pastHistory;

    /**
     * 体格检查
     */
    @TableField(value = "physical_examination")
    private String physicalExamination;

    /**
     * 辅助检查
     */
    @TableField(value = "auxiliary_examination")
    private String auxiliaryExamination;

    /**
     * 诊断
     */
    @TableField(value = "diagnosis")
    private String diagnosis;

    /**
     * 治疗方案
     */
    @TableField(value = "treatment")
    private String treatment;

    /**
     * 医嘱
     */
    @TableField(value = "medical_advice")
    private String medicalAdvice;

    /**
     * 病历文件存储路径
     */
    @TableField(value = "file_path")
    private String filePath;

    /**
     * 文件大小(字节)
     */
    @TableField(value = "file_size")
    private Long fileSize;

    /**
     * 文件类型(PDF/DOC等)
     */
    @TableField(value = "file_type")
    private String fileType;

    /**
     * 创建时间
     */
    @TableField(value = "created_at")
    private Date createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at")
    private Date updatedAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MedicalRecords other = (MedicalRecords) that;
        return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getPatientName() == null ? other.getPatientName() == null : this.getPatientName().equals(other.getPatientName()))
            && (this.getVisitDate() == null ? other.getVisitDate() == null : this.getVisitDate().equals(other.getVisitDate()))
            && (this.getDepartment() == null ? other.getDepartment() == null : this.getDepartment().equals(other.getDepartment()))
            && (this.getDoctor() == null ? other.getDoctor() == null : this.getDoctor().equals(other.getDoctor()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getChiefComplaint() == null ? other.getChiefComplaint() == null : this.getChiefComplaint().equals(other.getChiefComplaint()))
            && (this.getPresentIllness() == null ? other.getPresentIllness() == null : this.getPresentIllness().equals(other.getPresentIllness()))
            && (this.getPastHistory() == null ? other.getPastHistory() == null : this.getPastHistory().equals(other.getPastHistory()))
            && (this.getPhysicalExamination() == null ? other.getPhysicalExamination() == null : this.getPhysicalExamination().equals(other.getPhysicalExamination()))
            && (this.getAuxiliaryExamination() == null ? other.getAuxiliaryExamination() == null : this.getAuxiliaryExamination().equals(other.getAuxiliaryExamination()))
            && (this.getDiagnosis() == null ? other.getDiagnosis() == null : this.getDiagnosis().equals(other.getDiagnosis()))
            && (this.getTreatment() == null ? other.getTreatment() == null : this.getTreatment().equals(other.getTreatment()))
            && (this.getMedicalAdvice() == null ? other.getMedicalAdvice() == null : this.getMedicalAdvice().equals(other.getMedicalAdvice()))
            && (this.getFilePath() == null ? other.getFilePath() == null : this.getFilePath().equals(other.getFilePath()))
            && (this.getFileSize() == null ? other.getFileSize() == null : this.getFileSize().equals(other.getFileSize()))
            && (this.getFileType() == null ? other.getFileType() == null : this.getFileType().equals(other.getFileType()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getPatientName() == null) ? 0 : getPatientName().hashCode());
        result = prime * result + ((getVisitDate() == null) ? 0 : getVisitDate().hashCode());
        result = prime * result + ((getDepartment() == null) ? 0 : getDepartment().hashCode());
        result = prime * result + ((getDoctor() == null) ? 0 : getDoctor().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getChiefComplaint() == null) ? 0 : getChiefComplaint().hashCode());
        result = prime * result + ((getPresentIllness() == null) ? 0 : getPresentIllness().hashCode());
        result = prime * result + ((getPastHistory() == null) ? 0 : getPastHistory().hashCode());
        result = prime * result + ((getPhysicalExamination() == null) ? 0 : getPhysicalExamination().hashCode());
        result = prime * result + ((getAuxiliaryExamination() == null) ? 0 : getAuxiliaryExamination().hashCode());
        result = prime * result + ((getDiagnosis() == null) ? 0 : getDiagnosis().hashCode());
        result = prime * result + ((getTreatment() == null) ? 0 : getTreatment().hashCode());
        result = prime * result + ((getMedicalAdvice() == null) ? 0 : getMedicalAdvice().hashCode());
        result = prime * result + ((getFilePath() == null) ? 0 : getFilePath().hashCode());
        result = prime * result + ((getFileSize() == null) ? 0 : getFileSize().hashCode());
        result = prime * result + ((getFileType() == null) ? 0 : getFileType().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", recordId=").append(recordId);
        sb.append(", patientId=").append(patientId);
        sb.append(", patientName=").append(patientName);
        sb.append(", visitDate=").append(visitDate);
        sb.append(", department=").append(department);
        sb.append(", doctor=").append(doctor);
        sb.append(", status=").append(status);
        sb.append(", chiefComplaint=").append(chiefComplaint);
        sb.append(", presentIllness=").append(presentIllness);
        sb.append(", pastHistory=").append(pastHistory);
        sb.append(", physicalExamination=").append(physicalExamination);
        sb.append(", auxiliaryExamination=").append(auxiliaryExamination);
        sb.append(", diagnosis=").append(diagnosis);
        sb.append(", treatment=").append(treatment);
        sb.append(", medicalAdvice=").append(medicalAdvice);
        sb.append(", filePath=").append(filePath);
        sb.append(", fileSize=").append(fileSize);
        sb.append(", fileType=").append(fileType);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}